package other._1;

/**
 * @author mazouri
 * @create 2022-01-03 23:30
 */
public class Line {
    Point p1, p2;

    Line(Point p1, Point p2) {
        this.p1 = p1;
        this.p2 = p2;
    }

    public double getLength() {
        double dx = Math.abs(p1.x - p2.x);
        double dy = Math.abs(p1.y - p2.y);
        return Math.sqrt(dx * dx + dy * dy);
    }

    @Override
    public String toString() {
        return "Line{" + p1 + ", " + p2 + '}';
    }
}
